﻿using MasterMasterMode.Common.Systems;
using MasterMasterMode.Content.Invasions;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;

namespace MasterMasterMode.Content.Items.Consumables.Invasions
{
    public class MysteriousGoldfish : ModItem
    {
        public override void SetStaticDefaults()
        {
            Item.ResearchUnlockCount = 3;
        }
        public override void SetDefaults()
        {
            Item.width = 36;
            Item.height = 40;
            Item.scale = 1f;
            Item.useStyle = 4;
            Item.value = 0;
            Item.rare = 5;
            Item.useTime = 30;
            Item.useAnimation = 30;
            Item.UseSound = SoundID.Item1;
            Item.maxStack = Item.CommonMaxStack;
            Item.consumable = true;
        }

        public override bool? UseItem(Player player)
        {
            if (!InvasionSystem.ArmyofwarriorgoldfishesUp)
            {
                SoundEngine.PlaySound(SoundID.Roar, player.position);
                Main.NewText(Language.GetTextValue("Mods.MasterMasterMode.Invasion.3"), 175, 75, byte.MaxValue);
                ArmyofwarriorgoldfishesInvasion.StartCustomInvasion();
                return true;
            }
            return false;
        }
    }
}
